﻿using System;
using SAM.Framework.Log;
using log4net;

namespace SAM.Framework.Log4netAdapter
{
    public class DefaultLog4net<T> : ILog<T> where T: AbstractLogMessage
    {
        private ILog log; 
        public DefaultLog4net(ILog log)
        {
            this.log = log;
        } 

        public void Debug(T message)
        {
            this.log.Debug(message);
        }

        public void Debug(T message, Exception ex)
        {
            this.log.Debug(message, ex);
        }

        public void Info(T message)
        {
            this.log.Info(message);
        }

        public void Info(T message, Exception ex)
        {
            this.log.Info(message, ex);
        }

        public void Warn(T message)
        {
            this.log.Warn(message);
        }

        public void Warn(T message, Exception ex)
        {
            this.log.Warn(message, ex);
        }

        public void Error(T message)
        {
            this.log.Error(message);
        }

        public void Error(T message, Exception ex)
        {
            this.log.Error(message, ex);
        }

        public void Fatal(T message)
        {
            this.log.Fatal(message);
        }

        public void Fatal(T message, Exception ex)
        {
            this.log.Fatal(message, ex);
        }
    }
}
